Skip to content

Add regression test for enhanced SSL heads#100

Merged
lukifer23 merged 1 commit intomasterfrom
codex/add-test-module-for-policyvaluenet-with-ssl-tasks
Oct 6, 2025
Merged

Add regression test for enhanced SSL heads#100
lukifer23 merged 1 commit intomasterfrom
codex/add-test-module-for-policyvaluenet-with-ssl-tasks

Conversation

@lukifer23
Copy link
Owner

Summary

  • add a pytest covering PolicyValueNet when multiple enhanced SSL heads are enabled
  • validate that each head emits tensors with the expected shape and dtype and that SSL loss stays finite
  • ensure enabling or disabling individual SSL tasks immediately updates the tracked loss dictionary

Testing

  • pytest tests/test_ssl_heads.py

https://chatgpt.com/codex/tasks/task_e_68e41280034c832391dbf23dc5ddfcaa

Copilot AI review requested due to automatic review settings October 6, 2025 19:09
@lukifer23 lukifer23 merged commit 0e5580b into master Oct 6, 2025
@lukifer23 lukifer23 deleted the codex/add-test-module-for-policyvaluenet-with-ssl-tasks branch October 6, 2025 19:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive regression testing for enhanced SSL (Self-Supervised Learning) heads in the PolicyValueNet model. The test validates that multiple SSL tasks work correctly, producing tensors with expected shapes and maintaining finite loss values.

  • Validates SSL head outputs for piece, threat, pin, fork, and control tasks
  • Tests loss computation and ensures proper tracking of task-specific statistics
  • Verifies that enabling/disabling SSL tasks correctly updates the loss dictionary

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +23 to +26
if batch_size > len(boards):
boards.extend(boards[: batch_size - len(boards)])

tensors = [board_to_tensor(b) for b in boards[:batch_size]]
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The logic for extending boards when batch_size exceeds available boards could be clearer. Consider using modulo operation or explicit repetition with a comment explaining the behavior.

Suggested change
if batch_size > len(boards):
boards.extend(boards[: batch_size - len(boards)])
tensors = [board_to_tensor(b) for b in boards[:batch_size]]
# Repeat boards as necessary to ensure we have at least batch_size elements
import itertools
boards = list(itertools.islice(itertools.cycle(boards), batch_size))
tensors = [board_to_tensor(b) for b in boards]

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants